package com.qingcheng.controller.goods;

import com.alibaba.dubbo.config.annotation.Reference;
import com.qingcheng.service.goods.StockBackService;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * Created by yuanxin
 * Date:2019/7/18
 * Time:20:05
 */
@Component
public class SkuTask {

    @Reference
    private StockBackService stockBackService;

    /**
     * 测试:间隔一分钟执行库存回滚
     */
    @Scheduled(cron = "0 * * * * ? ")
    public void skuStockBack(){
        System.out.println("库存回滚开始了");
        stockBackService.doBack();
        System.out.println("库存回滚结束了");
    }
}
